import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import SearchView from '../views/SearchView.vue'
import ActivityView from '../views/ActivityView'
import ProductDetail from '../views/ProductDetail'
import SearchTwo from '../views/Search/SearchTwo'
import SearchKey from '../views/Search/SearchKey'
Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        children: [


        ],
        meta: {
            hearderNav: '首页',
            active: 0
        }
    },
    {
        path: '/search',
        component: SearchView,
        children: [
            {
                path: '/search',
                name: 'SearchView',
                component: SearchTwo,
            },
            {
                path: '/search/key:keywords',
                name: 'searchKey',
                component: SearchKey,
            },
        ]
    },
    {
        path: '/activity:pageId',
        name: 'ActivityView',
        component: ActivityView,
        meta: {
            hearderNav: '活动页面'
        }
    },
    //产品详情
    {
        path: '/productdetail:product_id',
        name: 'ProductDetail',
        component: ProductDetail,
        meta: {
            hearderNav: '产品详情'
        }
    },
    {
        path: '/destination',
        name: 'DestinationView',
        component: () => import('@/views/DestinationView'),
        meta: {
            hearderNav: '目的地',
            active: 1
        }
    },
    {
        path: '/find',
        name: 'FindView',
        component: () => import('@/views/FindView'),
        meta: {
            hearderNav: '斑马发现',
            active: 3
        }
    },
    {
        path: '/register',
        name: 'RegisterView',
        component: () => import('@/views/RegisterView'),
        meta: {
            hearderNav: '注册',
            active: 4
        }
    },
    {
        path: '/login',
        name: 'LoginView',
        component: () => import('@/views/LoginView'),
    },
    {
        path: '/individual',
        component: () => import('@/views/IndividualView.vue'),
        children: [
            {
                path: '/individual',
                name: "IndividualView",
                component: () => import('@/views/IndividualViewAB/IndividualViewA'),

            },
            {
                path: '/individual/team',
                name: "team",
                component: () => import('@/views/IndividualViewAB/IndividualViewB'),

            }

        ],
        meta: {
            hearderNav: '注册',
            active: 2
        }
    },

    //   {
    //     path: '/about',
    //     name: 'about',
    //     // route level code-splitting
    //     // this generates a separate chunk (about.[hash].js) for this route
    //     // which is lazy-loaded when the route is visited.
    //     component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    //   }
]

const router = new VueRouter({
    routes
})

export default router
